package com.practice.car.cardataapp.schelduer.spark.scheduler;

import com.practice.car.cardataapp.schelduer.spark.analy.ComplaintsRunner;
import com.practice.car.cardataapp.schelduer.spark.analy.RecomRunner;

import java.util.ArrayList;
import java.util.List;

/**
 * car-data-app project
 *
 * @author ZhangMingXing
 * @date 2020/9/13
 */
public class ComplaintsScheduler {
    private List<ComplaintsRunner> analyerList = new ArrayList<>();


    public void schedule() {
        //初始化spark应用，根据需求进行数据的初始化缓存
        //分发所需的数据并执行分析任务
        analyerList.forEach(ComplaintsRunner::run);
        //结束spark应用
    }
    public ComplaintsScheduler add(ComplaintsRunner runner) {
        analyerList.add(runner);
        return this;
    }
}